﻿

Public Class Player
    Private myName As String
    Private myHand As Hand
    Private myPosition As Position
    Private myTeam As Team
    Private myClient As ConnectedClient

    Public Property Hand As Hand
        Get
            Return myHand
        End Get
        Set(ByVal value As Hand)
            myHand = value
        End Set
    End Property

    Public ReadOnly Property Position As Position
        Get
            Return myPosition
        End Get
    End Property

    Public ReadOnly Property Team As Team
        Get
            Return myTeam
        End Get
    End Property

    Public ReadOnly Property Name As String
        Get
            Return myName
        End Get
    End Property


    Public ReadOnly Property Client As ConnectedClient
        Get
            Return myClient
        End Get
    End Property

    Public Sub New(ByVal name As String, ByVal position As Position)
        myName = name
        myPosition = position
        'hand will be dealt on trick creation
        myHand = Nothing
        If myPosition = EuchreGlobals.Position.First Or myPosition = EuchreGlobals.Position.Third Then
            myTeam = EuchreGlobals.Team.One
        Else
            myTeam = EuchreGlobals.Team.Two
        End If
    End Sub

    Public Sub New(ByRef client As ConnectedClient)
        myName = client.Username
        myPosition = client.Position
        'hand will be dealt on trick creation
        myHand = Nothing
        If myPosition = EuchreGlobals.Position.First Or myPosition = EuchreGlobals.Position.Third Then
            myTeam = EuchreGlobals.Team.One
        Else
            myTeam = EuchreGlobals.Team.Two
        End If
        myClient = client
    End Sub

End Class
